/** @file   irq.h
    @author M. P. Hayes, UCECE
    @date   08 June 2002
    @brief  Interrupt hardware abstraction
*/
#ifndef IRQ_H
#define IRQ_H

#include "config.h"

enum {IRQ_INT0 = BIT (INT0), IRQ_INT1 = BIT (INT1)};


/** Globally enable interrupts.  */
#define irq_global_enable() sei()

/** Globally disable interrupts.  */
#define irq_global_disable() cli()

/** Enable selected interrupts.
    @param INTS bit mask of interrupts to enable.  */
#define irq_enable(INTS) (GICR |= (INTS))

/** Disable selected interrupts.
    @param INTS bit mask of interrupts to disable.  */
#define irq_disable(INTS) (GICR &= ~(INTS))

/** Clear selected interrupts.
    @param INTS bit mask of interrupts to clear.  */
#define irq_clear(INTS) (GICR |= ~(INTS))

#endif  /* IRQ_H  */

